<template>
  <van-button v-bind="$attrs" @click.stop="handleClick">
    <template #[item]="data" v-for="item in Object.keys($slots, 'default')">
      <slot :name="item" v-bind="data || {}"></slot>
    </template>
  </van-button>
</template>
<script setup>
import throttle from "@/util/throttle/throttle";

const emit = defineEmits(['click'])
const props = defineProps({
  throttleTime: {
    type: Number,
    default: 300,
  },
})
const handleClick = () => {
  throttle(() => {
    emit('click')
  }, props.throttleTime)
}
</script>
